

//TODO a(20)
function a20(module, exports) {
    function addCss() {
        var e = ".debug{width:45%;position:absolute;left:0;top:350px;z-index:9999;background-color:#f4f7fe;border:1px solid #428ed4}.debug-menu{width:100%;height:30px;border-bottom:1px solid #428ed4;cursor:pointer;}.debug-menu input{float:right;margin-top:3px;}.debug-msg{overflow-y:auto;height:220px;border-bottom:1px solid #428ed4;}.debug-msg div{border-bottom:1px solid #428ed4;line-height:20px;}.debug-msg div.error{color:red;}#debug-command{width:70%;margin-right:5px;}", t = document.head || document.getElementsByTagName("head")[0] || document.documentElement, a = document.createElement("style");
        a.setAttribute("type", "text/css"), a.innerHTML = e, t.appendChild(a)
    }

    function log(e, t) {
        var a = "";
        switch (t) {
            case"E":
                a = "error";
                break;
            default:
                a = "info"
        }
        var i = document.createElement("div");
        i.className = a, i.innerHTML = (new Date).toLocaleTimeString() + "  " + e;
        var s = document.getElementsByClassName("debug-msg")[0];
        s.appendChild(i), s.scrollTop = s.scrollHeight
    }

    function addEvents() {
        document.getElementsByClassName("debug-clear")[0].ontouchstart = function () {
            document.getElementsByClassName("debug-msg")[0].innerHTML = ""
        }, document.getElementsByClassName("debug-close")[0].onclick = function () {
            dom.style.display = "none"
        }, document.getElementById("debug-execute").onclick = function () {
            var command = document.getElementById("debug-command").value;
            try {
                var result = eval(command);
                Debug.log(result)
            } catch (e) {
                Debug.log(e.message, "error")
            }
        }
    }

    function init(e) {
        addCss(), e = e || document.body, e.appendChild(dom), addEvents()
    }

    var model = '<div class="debug-menu"><input type="button" value="close" class="debug-close" /><input type="button" value="clear" class="debug-clear"/></div><div class="debug-msg"></div><div><input type="text" id="debug-command"/><input type="button" value="execute" id="debug-execute"/><input type="button" value="sendlog" id="debug-send-log"/></div>', dom = document.createElement("div");
    dom.className = "debug", dom.innerHTML = model, Debug = {init: init, log: log}, module.exports = Debug
}

